<?php
namespace app\admin\controller;

use think\Controller;
use think\Db;

session_start();
class Index extends Controller
// class Index
{


    public function index()
    {

        if($_SESSION['name']=="游客"||empty($_SESSION['name'])){
            return view('login/login',['title'=>'后台登录']);
        } else {
            $this->assign('title', '后首页');
            return $this->fetch('index/index');
        }
    }

    public function show()
    {
        //使用助手函数
        return view('index', ['title'=>'TP5后台']);
    }
    public function login()
    {
        $this->assign('title', '登录页面');
        return $this->fetch('login/login');
    }




}



